/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dale2507.gates.configurator.ui.components;

import javax.swing.ComboBoxModel;
import javax.swing.event.ListDataListener;
import org.bukkit.Material;

/**
 *
 * @author Dale
 */
class MaterialModel implements ComboBoxModel<Material> {
    
    private Material[] materials;
    private Material selected;

    public MaterialModel(Material[] materials) {
        this.materials = materials;
    }

    @Override
    public void setSelectedItem(Object anItem) {
        this.selected = (Material) anItem;
    }

    @Override
    public Object getSelectedItem() {
        return selected;
    }

    @Override
    public int getSize() {
        return materials.length;
    }

    @Override
    public Material getElementAt(int index) {
        return materials[index];
    }

    @Override
    public void addListDataListener(ListDataListener l) {
        
    }

    @Override
    public void removeListDataListener(ListDataListener l) {
        
    }
    
}
